home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / spawno30.zip / SPAWNVPE.C < prev    next >
C/C++ Source or Header  |  1990-09-13  |  1KB  |  38 lines

  1. /********************************************************************/
  2. /*   SPAWNO v2.0      XMS/disk swapping replacement for spawn...()  */
  3. /*   (c) Copyright 1990 Ralf Brown  All Rights Reserved         */
  4. /*                                    */
  5. /*   May be freely copied provided that this copyright notice is    */
  6. /*   not altered or removed.                        */
  7. /********************************************************************/
  8.  
  9. #include "spawno.h"
  10. #include <alloc.h>
  11. #include <errno.h>
  12.  
  13. extern int errno ;
  14. extern char *__spawn_env ;
  15. char * pascal __spawn_search(const char *) ;
  16. int pascal __spawn_buildenv(const char **) ;
  17.  
  18. int _Cdecl spawnvpeo(const char *overlay_path, const char *name, va_list args,
  19.             const char **env)
  20. {
  21.    char *prog_path = __spawn_search(name) ;
  22.    int retval ;
  23.  
  24.    if (prog_path)
  25.       {
  26.       retval = __spawnv(overlay_path,prog_path,args,__spawn_buildenv(env)) ;
  27.       free(__spawn_env) ;
  28.       return retval ;
  29.       }
  30.    else
  31.       {
  32.       errno = ENOENT ;    /* path or filename not found */
  33.             /* _doserrno already set by __spawn_search() */
  34.       return -1 ;
  35.       }
  36. }
  37.  
  38.